Move the idle sizer to GtkWindow
authorMatthias Clasen <mclasen@redhat.com>
Sun, 19 Apr 2020 15:43:57 +0000 (11:43 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 20 Apr 2020 20:30:45 +0000 (16:30 -0400)
This was only living in gtkcontainer.c for historic
reasons. Move it closer to where it belongs, and
rename it from 'idle' to 'layout', since it is
really about the layout phase of the frame clock,
nowadays.

23 files changed:
docs/reference/gtk/meson.build
gtk/gtkactionbar.c
gtk/gtkbutton.c
gtk/gtkcheckbutton.c
gtk/gtkcontainer.c
gtk/gtkcontainerprivate.h [deleted file]
gtk/gtkcsswidgetnode.c
gtk/gtkdialog.c
gtk/gtkexpander.c
gtk/gtkfixed.c
gtk/gtkflowbox.c
gtk/gtkframe.c
gtk/gtkgrid.c
gtk/gtkgridlayout.c
gtk/gtkheaderbar.c
gtk/gtklistbox.c
gtk/gtkmodelbutton.c
gtk/gtkpaned.c
gtk/gtksizegroup.c
gtk/gtkstack.c
gtk/gtkwidget.c
gtk/gtkwindow.c
gtk/gtkwindowprivate.h

index 91bab44088758f7533689258bd9864994ad3793c..8b66214e2071a8c638df02e09f262d8b86723aed 100644 (file)
@@ -23,7 +23,6 @@ private_headers = [
   'gtkcolorscaleprivate.h',
   'gtkcolorswatchprivate.h',
   'gtkcomboboxprivate.h',
-  'gtkcontainerprivate.h',
   'gtkconstraintexpressionprivate.h',
   'gtkconstraintguideprivate.h',
   'gtkconstraintlayoutprivate.h',
index ad468a07056edf4a10ddc06c4b46f8772c980ca1..3705e46d9fb12850344e8ea14c349d67c00e6c28 100644 (file)
@@ -27,7 +27,6 @@
 #include "gtkbox.h"
 #include "gtkrevealer.h"
 #include "gtkwidgetprivate.h"
-#include "gtkcontainerprivate.h"
 #include "gtkprivate.h"
 #include "gtkcenterbox.h"
 #include "gtkbinlayout.h"
index 666c403a0fa50191a51c79b9080e9ced0f4a98f6..947e440a6377a8338255522a80613f8369ae0808 100644 (file)
@@ -57,7 +57,6 @@
 
 #include "gtkactionhelperprivate.h"
 #include "gtkcheckbutton.h"
-#include "gtkcontainerprivate.h"
 #include "gtkgestureclick.h"
 #include "gtkeventcontrollerkey.h"
 #include "gtkimage.h"
index 795e41c2de76e115533ed06e78c4079d89c19892..5411ef5d9ce2fcafceae31d1d9d9098b0682e076 100644 (file)
@@ -33,7 +33,6 @@
 #include "gtkprivate.h"
 #include "gtkwidgetprivate.h"
 #include "gtkcssnodeprivate.h"
-#include "gtkcontainerprivate.h"
 #include "gtkstylecontextprivate.h"
 #include "gtkcssnumbervalueprivate.h"
 #include "gtkradiobutton.h"
index a2cbd1b8b985876b3af47b3cdd8bccc369c68459..38ef0b1399010c1ec6440491736a32891017b836 100644 (file)
@@ -24,8 +24,6 @@
 
 #include "config.h"
 
-#include "gtkcontainerprivate.h"
-
 #include "gtkadjustment.h"
 #include "gtkbuildable.h"
 #include "gtkbuilderprivate.h"
  * See more about implementing custom widgets at https://wiki.gnome.org/HowDoI/CustomWidgets
  */
 
-
-struct _GtkContainerPrivate
-{
-  guint resize_handler;
-
-  guint restyle_pending    : 1;
-};
-
 enum {
   ADD,
   REMOVE,
@@ -120,7 +110,6 @@ static GtkBuildableIface    *parent_buildable_iface;
 static guint                 container_signals[LAST_SIGNAL] = { 0 };
 
 G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkContainer, gtk_container, GTK_TYPE_WIDGET,
-                                  G_ADD_PRIVATE (GtkContainer)
                                   G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
                                                          gtk_container_buildable_init))
 
@@ -236,10 +225,6 @@ static void
 gtk_container_destroy (GtkWidget *widget)
 {
   GtkContainer *container = GTK_CONTAINER (widget);
-  GtkContainerPrivate *priv = gtk_container_get_instance_private (container);
-
-  if (priv->restyle_pending)
-    priv->restyle_pending = FALSE;
 
   gtk_container_foreach (container, (GtkCallback) gtk_widget_destroy, NULL);
 
@@ -324,113 +309,6 @@ gtk_container_remove (GtkContainer *container,
   g_object_unref (container);
 }
 
-static gboolean
-gtk_container_needs_idle_sizer (GtkContainer *container)
-{
-  GtkContainerPrivate *priv = gtk_container_get_instance_private (container);
-
-  if (priv->restyle_pending)
-    return TRUE;
-
-  return gtk_widget_needs_allocate (GTK_WIDGET (container));
-}
-
-static void
-gtk_container_idle_sizer (GdkFrameClock *clock,
-                         GtkContainer  *container)
-{
-  GtkContainerPrivate *priv = gtk_container_get_instance_private (container);
-
-  /* We validate the style contexts in a single loop before even trying
-   * to handle resizes instead of doing validations inline.
-   * This is mostly necessary for compatibility reasons with old code,
-   * because both css_changed and size_allocate functions often change
-   * styles and so could cause infinite loops in this function.
-   *
-   * It's important to note that even an invalid style context returns
-   * sane values. So the result of an invalid style context will never be
-   * a program crash, but only a wrong layout or rendering.
-   */
-  if (priv->restyle_pending)
-    {
-      priv->restyle_pending = FALSE;
-      gtk_css_node_validate (gtk_widget_get_css_node (GTK_WIDGET (container)));
-    }
-
-  /* we may be invoked with a container_resize_queue of NULL, because
-   * queue_resize could have been adding an extra idle function while
-   * the queue still got processed. we better just ignore such case
-   * than trying to explicitly work around them with some extra flags,
-   * since it doesn't cause any actual harm.
-   */
-  if (gtk_widget_needs_allocate (GTK_WIDGET (container)))
-    {
-      if (GTK_IS_ROOT (container))
-        gtk_native_check_resize (GTK_NATIVE (container));
-      else
-        g_warning ("gtk_container_idle_sizer() called on a non-native non-window");
-    }
-
-  if (!gtk_container_needs_idle_sizer (container))
-    {
-      gtk_container_stop_idle_sizer (container);
-    }
-  else
-    {
-      gdk_frame_clock_request_phase (clock,
-                                     GDK_FRAME_CLOCK_PHASE_LAYOUT);
-    }
-}
-
-void
-gtk_container_start_idle_sizer (GtkContainer *container)
-{
-  GtkContainerPrivate *priv = gtk_container_get_instance_private (container);
-  GdkFrameClock *clock;
-
-  if (priv->resize_handler != 0)
-    return;
-
-  if (!gtk_container_needs_idle_sizer (container))
-    return;
-
-  clock = gtk_widget_get_frame_clock (GTK_WIDGET (container));
-  if (clock == NULL)
-    return;
-
-  priv->resize_handler = g_signal_connect (clock, "layout",
-                                           G_CALLBACK (gtk_container_idle_sizer), container);
-  gdk_frame_clock_request_phase (clock,
-                                 GDK_FRAME_CLOCK_PHASE_LAYOUT);
-}
-
-void
-gtk_container_stop_idle_sizer (GtkContainer *container)
-{
-  GtkContainerPrivate *priv = gtk_container_get_instance_private (container);
-
-  if (priv->resize_handler == 0)
-    return;
-
-  g_signal_handler_disconnect (gtk_widget_get_frame_clock (GTK_WIDGET (container)),
-                               priv->resize_handler);
-  priv->resize_handler = 0;
-}
-
-void
-_gtk_container_queue_restyle (GtkContainer *container)
-{
-  GtkContainerPrivate *priv = gtk_container_get_instance_private (container);
-
-  g_return_if_fail (GTK_CONTAINER (container));
-
-  if (priv->restyle_pending)
-    return;
-
-  priv->restyle_pending = TRUE;
-  gtk_container_start_idle_sizer (container);
-}
-
 static GtkSizeRequestMode 
 gtk_container_get_request_mode (GtkWidget *widget)
 {
diff --git a/gtk/gtkcontainerprivate.h b/gtk/gtkcontainerprivate.h
deleted file mode 100644 (file)
index 74f24dd..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* GTK - The GIMP Toolkit
- *
- * Copyright (C) 2011 Javier Jardón
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef __GTK_CONTAINER_PRIVATE_H__
-#define __GTK_CONTAINER_PRIVATE_H__
-
-#include "gtkcontainer.h"
-#include <gsk/gsk.h>
-
-G_BEGIN_DECLS
-
-
-void     _gtk_container_queue_restyle          (GtkContainer *container);
-void      gtk_container_stop_idle_sizer         (GtkContainer     *container);
-void      gtk_container_start_idle_sizer        (GtkContainer     *container);
-void      gtk_container_set_focus_child         (GtkContainer     *container,
-                                                 GtkWidget        *child);
-
-
-G_END_DECLS
-
-#endif /* __GTK_CONTAINER_PRIVATE_H__ */
index 7a3a37ffc1c7907e26720a9fc74449606f60d91a..b8aaf4530249c45b92adc71c9ee23d4b54122e84 100644 (file)
 
 #include "gtkcsswidgetnodeprivate.h"
 
-#include "gtkcontainerprivate.h"
 #include "gtkcssanimatedstyleprivate.h"
 #include "gtkprivate.h"
 #include "gtksettingsprivate.h"
 #include "gtkstylecontextprivate.h"
 #include "gtkwidgetprivate.h"
+#include "gtkwindowprivate.h"
 
 G_DEFINE_TYPE (GtkCssWidgetNode, gtk_css_widget_node, GTK_TYPE_CSS_NODE)
 
@@ -46,7 +46,7 @@ gtk_css_widget_node_queue_callback (GtkWidget     *widget,
   GtkCssNode *node = user_data;
 
   gtk_css_node_invalidate_frame_clock (node, TRUE);
-  _gtk_container_queue_restyle (GTK_CONTAINER (widget));
+  gtk_window_queue_restyle (GTK_WINDOW (widget));
 
   return G_SOURCE_CONTINUE;
 }
@@ -56,9 +56,7 @@ gtk_css_widget_node_queue_validate (GtkCssNode *node)
 {
   GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
 
-  if (widget_node->widget &&
-      GTK_IS_ROOT (widget_node->widget) &&
-      GTK_IS_CONTAINER (widget_node->widget))
+  if (widget_node->widget && GTK_IS_ROOT (widget_node->widget))
     widget_node->validate_cb_id = gtk_widget_add_tick_callback (widget_node->widget,
                                                                 gtk_css_widget_node_queue_callback,
                                                                 node,
index a2cc9e15eff9236ea227d51d2cfd652ac2046882..f0c73d67f94a180f3311a0b457c0c03b42bd5617 100644 (file)
@@ -35,7 +35,6 @@
 #include "gtklabel.h"
 #include "gtkmarshalers.h"
 #include "gtkbox.h"
-#include "gtkcontainerprivate.h"
 #include "gtkmain.h"
 #include "gtkintl.h"
 #include "gtkprivate.h"
index d7d4f89ec3da01086f52a51ca7db62cebaa17025..0cd753fe01407d01a419d1a2626edc07a50404a8 100644 (file)
 
 #include "gtkbox.h"
 #include "gtkbuildable.h"
-#include "gtkcontainerprivate.h"
 #include "gtkdropcontrollermotion.h"
 #include "gtkbuiltiniconprivate.h"
 #include "gtkgestureclick.h"
index 8049b70e43da33555345a07b953c5170d8b0418f..3d35f0a24bd09360239bbdd79985e54e1d7d1c00 100644 (file)
@@ -71,7 +71,6 @@
 
 #include "gtkfixed.h"
 
-#include "gtkcontainerprivate.h"
 #include "gtkfixedlayout.h"
 #include "gtkintl.h"
 #include "gtkprivate.h"
index 7fb0a58857e5289f21b4c7804c2a2631e3e75eae..e0f0a6131775ffc08826925294e8631b0260065e 100644 (file)
@@ -79,7 +79,6 @@
 #include "gtkflowboxprivate.h"
 
 #include "gtkadjustment.h"
-#include "gtkcontainerprivate.h"
 #include "gtkcsscolorvalueprivate.h"
 #include "gtkcssnodeprivate.h"
 #include "gtkgesturedrag.h"
index 00d7333c5574318fb7664d4eb478ec249403bf94..26880beb20980ef295ea671fb0a53eefa41a8132 100644 (file)
@@ -32,7 +32,6 @@
 #include "gtkbuildable.h"
 #include "gtkcssnodeprivate.h"
 #include "gtkwidgetprivate.h"
-#include "gtkcontainerprivate.h"
 #include "gtkstylecontextprivate.h"
 #include "gtkcssstylepropertyprivate.h"
 #include "gtklabel.h"
index a0c3ac107ef5f08720b8ef5b92410b1e6208b4dd..89af6bc31179238f2948b269785759ffac1290e0 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "gtkgrid.h"
 
-#include "gtkcontainerprivate.h"
 #include "gtkcsspositionvalueprivate.h"
 #include "gtkgridlayout.h"
 #include "gtkorientableprivate.h"
index f913490741546b3e6d06527901558618ad5260b9..b77169e76f8455f6a3afd432b73293bcb3b55c12 100644 (file)
@@ -44,7 +44,6 @@
 
 #include "gtkgridlayout.h"
 
-#include "gtkcontainerprivate.h"
 #include "gtkcsspositionvalueprivate.h"
 #include "gtkdebug.h"
 #include "gtkintl.h"
index eb5bca55a4dbdfd433e589e6e00002e15b7741ae..b9a1495233e658b40682383603ccfe83e3a658ed 100644 (file)
@@ -25,7 +25,6 @@
 #include "gtkbutton.h"
 #include "gtkbuildable.h"
 #include "gtkcenterlayout.h"
-#include "gtkcontainerprivate.h"
 #include "gtkcssnodeprivate.h"
 #include "gtkimage.h"
 #include "gtkintl.h"
index 2ca063710e07ca658b2a63dd664b3cd8599ed9a5..28f72990230ae0f37a67f937416db6e77d220c3f 100644 (file)
@@ -22,7 +22,6 @@
 #include "gtkactionhelperprivate.h"
 #include "gtkadjustmentprivate.h"
 #include "gtkbuildable.h"
-#include "gtkcontainerprivate.h"
 #include "gtkcssnodeprivate.h"
 #include "gtkgestureclick.h"
 #include "gtkintl.h"
index a6501c1dd5f632543fc4e7d7b0677dde32779b53..61b9e3a955f5d67b66387387166b2342c24dec35 100644 (file)
@@ -37,7 +37,6 @@
 #include "gtkcssnodeprivate.h"
 #include "gtkcsstypesprivate.h"
 #include "gtkstylecontextprivate.h"
-#include "gtkcontainerprivate.h"
 #include "gtkbuiltiniconprivate.h"
 #include "gtksizegroup.h"
 #include "gtkaccellabelprivate.h"
index a4f0a5bd240f77a4cb00338389c9d0a6548031f9..b39d5bd56a8f5c50506c7167c218c6376c86735b 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "gtkpaned.h"
 
-#include "gtkcontainerprivate.h"
 #include "gtkcssnodeprivate.h"
 #include "gtkcssstylepropertyprivate.h"
 #include "gtkeventcontrollermotion.h"
index 2be53f5214463df5bdbecc41db224ac8fe01465a..047ac24e168060d2bedd71a021f648903ddb29cf 100644 (file)
@@ -27,7 +27,6 @@
 #include "gtkprivate.h"
 #include "gtksizegroup-private.h"
 #include "gtkwidgetprivate.h"
-#include "gtkcontainerprivate.h"
 
 
 /**
index 887c9cf6c9667eaf13448aee2d9a63ee46681aa8..2efdd2be0694ceed07dcc5cfe11723fb3189e371 100644 (file)
@@ -25,7 +25,6 @@
 #include "gtkstack.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
-#include "gtkcontainerprivate.h"
 #include "gtkprogresstrackerprivate.h"
 #include "gtksettingsprivate.h"
 #include "gtksnapshot.h"
index f21586913b8d3c63d6f173619c833b380ce736e7..b1c9bea8bd42afe46f49d3e636830cef2c92ed4b 100644 (file)
@@ -31,7 +31,6 @@
 #include "gtkapplicationprivate.h"
 #include "gtkbuildable.h"
 #include "gtkbuilderprivate.h"
-#include "gtkcontainerprivate.h"
 #include "gtkcssboxesprivate.h"
 #include "gtkcssfiltervalueprivate.h"
 #include "gtkcsstransformvalueprivate.h"
@@ -3104,9 +3103,6 @@ gtk_widget_connect_frame_clock (GtkWidget *widget)
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
   GdkFrameClock *frame_clock;
 
-  if (GTK_IS_CONTAINER (widget) && GTK_IS_ROOT (widget))
-    gtk_container_start_idle_sizer (GTK_CONTAINER (widget));
-
   frame_clock = gtk_widget_get_frame_clock (widget);
 
   if (priv->tick_callbacks != NULL && !priv->clock_tick_id)
@@ -3125,9 +3121,6 @@ gtk_widget_disconnect_frame_clock (GtkWidget *widget)
 {
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
 
-  if (GTK_IS_CONTAINER (widget) && GTK_IS_ROOT (widget))
-    gtk_container_stop_idle_sizer (GTK_CONTAINER (widget));
-
   gtk_css_node_invalidate_frame_clock (priv->cssnode, FALSE);
 
   if (priv->clock_tick_id)
@@ -10444,9 +10437,9 @@ gtk_widget_set_alloc_needed (GtkWidget *widget)
       if (!priv->visible)
         break;
 
-      if (GTK_IS_ROOT (widget))
+      if (GTK_IS_WINDOW (widget))
         {
-          gtk_container_start_idle_sizer (GTK_CONTAINER (widget));
+          gtk_window_start_layout (GTK_WINDOW (widget));
           break;
         }
 
index fdc0cf8f1be490357fe6b07341eb393513d6a392..c02742e0550fc8f0ec466e5b761ef91be14fa72f 100644 (file)
@@ -33,7 +33,6 @@
 #include "gtkbuilderprivate.h"
 #include "gtkbutton.h"
 #include "gtkcheckbutton.h"
-#include "gtkcontainerprivate.h"
 #include "gtkcsscornervalueprivate.h"
 #include "gtkcssiconthemevalueprivate.h"
 #include "gtkcsscolorvalueprivate.h"
@@ -239,8 +238,12 @@ typedef struct
   guint    hide_on_close             : 1;
   guint    in_emit_close_request     : 1;
 
+  guint    restyle_pending           : 1;
+
   GdkSurfaceTypeHint type_hint;
 
+  guint resize_handler;
+
   GtkGesture *click_gesture;
   GtkGesture *drag_gesture;
   GtkGesture *bubble_drag_gesture;
@@ -3997,6 +4000,9 @@ gtk_window_destroy (GtkWidget *widget)
   if (priv->group)
     gtk_window_group_remove_window (priv->group, window);
 
+  if (priv->restyle_pending)
+    priv->restyle_pending = FALSE;
+
   GTK_WIDGET_CLASS (gtk_window_parent_class)->destroy (widget);
 }
 
@@ -4798,6 +4804,8 @@ gtk_window_realize (GtkWidget *widget)
 
   GTK_WIDGET_CLASS (gtk_window_parent_class)->realize (widget);
 
+  gtk_window_start_layout (window);
+
   if (priv->renderer == NULL)
     priv->renderer = gsk_renderer_new_for_surface (surface);
 
@@ -4913,6 +4921,8 @@ gtk_window_unrealize (GtkWidget *widget)
   g_signal_handlers_disconnect_by_func (surface, surface_render, widget);
   g_signal_handlers_disconnect_by_func (surface, surface_event, widget);
 
+  gtk_window_stop_layout (window);
+
   GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
 
   gdk_surface_set_widget (surface, NULL);
@@ -8008,3 +8018,100 @@ gtk_window_maybe_update_cursor (GtkWindow *window,
         break;
     }
 }
+
+static gboolean
+gtk_window_needs_layout (GtkWindow *window)
+{
+  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
+
+  if (priv->restyle_pending)
+    return TRUE;
+
+  return gtk_widget_needs_allocate (GTK_WIDGET (window));
+}
+
+static void
+gtk_window_layout_cb (GdkFrameClock *clock,
+                      GtkWindow     *window)
+{
+  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
+  GtkWidget *widget = GTK_WIDGET (window);
+
+  /* We validate the style contexts in a single loop before even trying
+   * to handle resizes instead of doing validations inline.
+   * This is mostly necessary for compatibility reasons with old code,
+   * because both css_changed and size_allocate functions often change
+   * styles and so could cause infinite loops in this function.
+   *
+   * It's important to note that even an invalid style context returns
+   * sane values. So the result of an invalid style context will never be
+   * a program crash, but only a wrong layout or rendering.
+   */
+  if (priv->restyle_pending)
+    {
+      priv->restyle_pending = FALSE;
+      gtk_css_node_validate (gtk_widget_get_css_node (widget));
+    }
+
+  /* we may be invoked with a container_resize_queue of NULL, because
+   * queue_resize could have been adding an extra idle function while
+   * the queue still got processed. we better just ignore such case
+   * than trying to explicitly work around them with some extra flags,
+   * since it doesn't cause any actual harm.
+   */
+  if (gtk_widget_needs_allocate (widget))
+    gtk_native_check_resize (GTK_NATIVE (window));
+
+  if (!gtk_window_needs_layout (window))
+    gtk_window_stop_layout (window);
+  else
+    gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_LAYOUT);
+}
+
+void
+gtk_window_start_layout (GtkWindow *window)
+{
+  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
+  GdkFrameClock *clock;
+
+  if (priv->resize_handler != 0)
+    return;
+
+  if (!gtk_window_needs_layout (window))
+    return;
+
+  clock = gtk_widget_get_frame_clock (GTK_WIDGET (window));
+  if (clock == NULL)
+    return;
+
+  priv->resize_handler = g_signal_connect (clock, "layout",
+                                           G_CALLBACK (gtk_window_layout_cb), window);
+  gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_LAYOUT);
+}
+
+void
+gtk_window_stop_layout (GtkWindow *window)
+{
+  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
+  GdkFrameClock *clock;
+
+  if (priv->resize_handler == 0)
+    return;
+
+  clock = gtk_widget_get_frame_clock (GTK_WIDGET (window));
+  g_signal_handler_disconnect (clock, priv->resize_handler);
+  priv->resize_handler = 0;
+}
+
+void
+gtk_window_queue_restyle (GtkWindow *window)
+{
+  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
+
+  if (priv->restyle_pending)
+    return;
+
+  priv->restyle_pending = TRUE;
+
+  gtk_window_start_layout (window);
+}
index 948644f574ec17548038eb52f43b6198643f2d68..1cde20fc808555dfbad63aaa149731662547a539 100644 (file)
@@ -141,6 +141,11 @@ GtkWidget *      gtk_window_pick_popover (GtkWindow   *window,
 void             gtk_window_set_extra_input_region (GtkWindow      *window,
                                                     cairo_region_t *region);
 
+void             gtk_window_start_layout  (GtkWindow *window);
+void             gtk_window_stop_layout   (GtkWindow *window);
+void             gtk_window_queue_restyle (GtkWindow *window);
+
+
 G_END_DECLS
 
 #endif /* __GTK_WINDOW_PRIVATE_H__ */